package com.wang;


import com.wang.model.Order;
import com.wang.service.OrderService;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import sun.applet.Main;

public class ConsumeMain {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("consumer.xml");
        OrderService orderService = (OrderService) ctx.getBean("remoteOrderService");
        System.out.println("orderService是代理"+orderService.getClass());
        //通过接口的代理对象调用方法 方法是在提供者进程中执行的
        Order order = orderService.createOrder(1,"电脑",7999F,2);
        System.out.println("消费者调用提供者的方法，得到订单对象"+order.getOrderId());
    }
}
